<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<script type="text/javascript">
			// let arr = new Array();
			/*
			  Set:存储的值唯一(不允许重复的值)
			  1.增
			  add()
			  2.查
			  forEach()
			  size
			  3.判断
			  has()
			  4.删
			  
			  数组->Set
			  Set->数组
			
			
			*/
			let s1 = new Set();
			//-------------增------------------------------
			s1.add(1);
			s1.add(2);
			s1.add(3);
			s1.add(3);
			//-------------查-------------------------------
			// s1.forEach(val => console.log(val));
			// console.log(s1.size);
			//-------------判断-------------------------------
			// console.log(s1.has(22));
			//-------------删-------------------------------
			// console.log(s1.delete(2));
			// console.log(s1);

			//------------- 数组->Set-----------------------------------
			let arr = [1, 2, 3, 3];
			var s2 = new Set(arr);
			// console.log(s2);
			//------------- Set->数组-----------------------------------
			let arr2 = [...s2];
			// console.log(arr2);

			let s3 = new Set("test");
			console.log(s3);
		</script>
	</body>
</html>
